<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  </head>
  
  <body>
    ${pageContext.request.contextPath}
    <br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/><br/>
    <br/>
    <%=request.getRemoteHost() %>
    <br />
    <%=request.getRemoteAddr() %>
    <br />
    <%=request.getRemotePort() %>
    <br />
    <%=request.getRemoteUser() %>
    <%
    	Enumeration enumeration = request.getHeaderNames();
    	String name = null;
    	for(;enumeration.hasMoreElements();){
    		 name = enumeration.nextElement().toString();
    		 System.out.println(name);
    	}
    	System.out.println(request.getHeader("user-agent"));
    	System.out.println(request.getHeader("cookie"));
     %>
    <textarea  id="mytext" name="mytext" rows="2" cols="20"></textarea>
  </body>
  <script type="text/javascript">
  document.getElementById('mytext').innerHTML = "window.navigator.appCodeName:"+window.navigator.appCodeName
  					+"\r\n"+"window.navigator.appName:"+window.navigator.appName
  					+"\r\n"+"window.navigator.appVersion:"+window.navigator.appVersion
  					+"\r\n"+"window.navigator.appMinorVersion:"+window.navigator.appMinorVersion;
  
  
  alert(screen.width);
  alert(screen.height);
  					
  					
  /*
  var Sys = {};
        var ua = navigator.userAgent.toLowerCase();
        var s;
        var browser = (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
        (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
        (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
        (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
        (s = uatr.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;

        alert(browser);
       */
  </script>
</html>
